<CFQUERY NAME="qryCHECKMAIN" DATASOURCE=#client.company_dsn#>
	SELECT *
	FROM ECRGFORMS
	WHERE COPYTOFORMCODE = '#GetForm.COPYTOFORMCODE#'
</CFQUERY>
<CFLOOP INDEX="x" FROM="1" TO="5">
	<CFIF evaluate("qryCHECKMAIN.PK_FIELD" & x) NEQ "">
		<CFSET theVal = evaluate("url." & evaluate("qryCHECKMAIN.PK_FIELD" & x))>
		<CFQUERY NAME="qryUpdateApproved" DATASOURCE=#client.company_dsn#>
			UPDATE #GetForm.TABLENAME_FK#
			SET APPROVED='C'
			WHERE (#ucase(evaluate("qryCHECKMAIN.PK_FIELD" & x))# = '#theVal#')
		</CFQUERY>
	</CFIF>
</CFLOOP>
